home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / files / lgets < prev    next >
Encoding:
Text File  |  1993-10-26  |  1.4 KB  |  25 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.           lgets fileId ?varName?
  4.                Reads the next Tcl list from the file given  by  fileId
  5.                and  discards  the terminating newline character.  This
  6.                command differs from the gets command, in that it reads
  7.                Tcl  lists  rather  than lines.  If the list contains a
  8.                newline, then that newline will be returned as part  of
  9.                the  result.   Only a newline not quoted as part of the
  10.                list indicates the  end  of  the  list.   There  is  no
  11.                corresponding command for outputing lists, as puts will
  12.                do this correctly.  If varName is specified,  then  the
  13.                line  is  placed  in  the variable by that name and the
  14.                return value is a count of  the  number  of  characters
  15.                read  (not  including  the newline).  If the end of the
  16.                file is reached before reading any characters  then  -1
  17.                is  returned and varName is set to an empty string.  If
  18.                varName is not specified then the return value will  be
  19.                the  line  (minus  the  newline  character) or an empty
  20.                string if the end of the file is reached before reading
  21.                any  characters.  An empty string will also be returned
  22.                if a line contains no characters except the newline, so
  23.                eof  may  have to be used to determine what really hap-
  24.                pened.
  25.